/* SPDX-License-Identifier: GPL-2.0 */

#ifndef EULEROS_DIM_CORE_POLICY_H
#define EULEROS_DIM_CORE_POLICY_H

#include <linux/types.h>

enum dim_core_policy_action {
	ACTION_LOG,
	ACTION_KILL,
	POLICY_ACTION_LAST,
};

/**
 * dim_policy_load() - load dim policy from disk
 *
 * Returns: 0 on success or errno on failure
 */
int dim_policy_load(void);

/**
 * dim_policy_destroy() - free memory for policy
 */
void dim_policy_destroy(void);

/**
 * dim_policy_has_item() - check if an item is in dim policy
 * @path: file name for searching
 *
 * Returns: true or false
 */
bool dim_policy_has_item(char *path);

/**
 * dim_policy_get_action() - get action if an item is in dim policy
 * @path: file name for searching
 *
 * Returns: action value
 */
enum dim_core_policy_action dim_policy_get_action(const char *path);

#endif /* EULEROS_DIM_CORE_POLICY_H */
